package com.zyw.module.console.sys.service;

import com.zyw.module.console.sys.dao.NoticeDao;
import com.zyw.module.console.sys.po.Notice;
import com.zyw.mvc.support.BaseService;
import com.zyw.orm.support.page.Page;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class NoticeService extends BaseService<Notice, Integer, NoticeDao> {

    public Notice get(Integer id) {
        return getDao().selectByPrimaryKey(id);
    }

    @Transactional
    public int insert(Notice record) {
        return getDao().insert(record);
    }

    @Transactional
    public int update(Notice record) {
        return getDao().updateByPrimaryKey(record);
    }

    @Transactional
    public int delete(Integer id) {
        return getDao().deleteByPrimaryKey(id);
    }

    public List<Notice> findByPage(Page<Notice> page) {
        List<Notice> list = getDao().findByPage(page);
        page.setList(list);
        return list;
    }
}